home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 803 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.1 KB

  1. Path: ohstpy.mps.ohio-state.edu!vancleef
  2. From: vancleef@ohstpy.mps.ohio-state.edu
  3. Newsgroups: comp.lang.eiffel,comp.lang.ada,comp.edu,comp.lang.c,comp.lang.c++,comp.lang.modula2,comp.lang.modula3
  4. Subject: Re: Hungarian notation
  5. Message-ID: <1996Jan7.045815.8676@ohstpy>
  6. Date: 7 Jan 96 04:58:15 -0500
  7. References: <30C40F77.53B5@swsbbs.com> <30EF0415.6FE1@tus.ssi1.com>
  8. Organization: The Ohio State University, Department of Physics
  9.  
  10. In article <30EF0415.6FE1@tus.ssi1.com>, Mike Palmer <Mike.Palmer@tus.ssi1.com> writes:
  11. > Joachim Durchholz wrote:
  12. >> 
  13. >> > Consider also that variable names may be misleading anyway. In that
  14. >> > sense there's no great difference between
  15. >> >
  16. >> >         someProc(MyString)
  17. >> >
  18. >> > and
  19. >> >
  20. >> >         someProc(pszMyString)
  21. >> >
  22. >> > either could quite happily refer to any other data type.
  23. >> >
  24. >> 
  25. >> This example does not occur in real life. Or rather, it better should not!
  26. >> Anybody using meaningless names like "MyString" should be thrown out of
  27. >> the programming business. Depending on the actual semantics of "someProc",
  28. >> the parameter should be called "Message" or "Options" or "ParserInput" or
  29. >> whatever.
  30. >> 
  31. >> -Joachim
  32. >  
  33. > One hopes you just missed the point here. Hungarian notation does not attempt
  34. > to help you keep track of _what_ your variable is, it gives you a framework 
  35. > to keep track of what _kind_ of variable it is. One would also note that 
  36. > someProc is not a very descriptive name, but so what? In the first example, I
  37. > have _no_ clue what type of variable MyString is, although I could probably 
  38. > deduce that it is a string. In the second example, the prefix tells me that 
  39. > it is a Pointer to a Zero terminated String. 
  40.  
  41. How often do you use NON-ZERO terminated strings??? HN is
  42. useless garbage in C++, or for ANSI C compilers.
  43.  
  44. HN is for rank amatuers IMHO, or Micro$oft employees :)
  45. BTW, how *do* you do HN in c++???
  46.  
  47. -Garret
  48.  
  49. > -- Mike --
  50. > ---- Mike Palmer --------------- Mike.Palmer@tus.ssi1.com ----
  51. > ----      The opinions expressed here are mine, and       ----
  52. > ----         not those of my employer or of TDK.          ----
  53.